package com.craney.aboutDrawing
{
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.geom.Point;
	
	public class TestPoint extends Sprite
	{
		public function TestPoint()
		{
			super();
			
			this.x = 300;
			this.y = 300;
			var p1:Point = new Point(100, 100);
			var p2:Point = new Point(200, 200);
			trace(Point.distance(p1, p2));
			var p3:Point = this.localToGlobal(p1);
			var p4:Point = this.globalToLocal(p1);
			trace("p3 = " + p3);
			trace("p4 = " + p4);
			
			var shp:Shape = new Shape;
			shp.graphics.lineStyle(3, 0xffcc00);
			shp.graphics.drawRect(0, 0, 200, 140);
			
			
			
//			shp.graphics.drawCircle(-100, -100, 2);
			addChild(shp);
			
			var angle:Number = Math.PI * 5 / 4;
			var distance:Number = 100 * Math.SQRT2;
			var vector:Point = Point.polar(distance, angle);
			
			shp.x += vector.x;
			shp.y += vector.y;
			
		}

	}
}